home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 3 code / Surf's Up! / Interfaces / CIncludes / CRMIntf.h < prev    next >
Encoding:
Text File  |  1989-11-17  |  2.2 KB  |  86 lines  |  [TEXT/MPS ]

  1. //
  2. //    CRMIntf.h
  3. //    C interface to the Communications Resource Manager
  4. //
  5. //    Copyright © Apple Computer, Inc.  1988, 1989
  6. //    All rights reserved
  7. //
  8. //
  9.  
  10. #ifndef __CRMINTF__
  11. #define __CRMINTF__
  12.  
  13. #ifndef __OSUTILS__
  14. #include <OSUtils.h>
  15. #endif
  16.  
  17. //    version of the Comm Resource Manager
  18. #define                curCRMVersion        1
  19.  
  20. //    tool classes (also the tool file types)
  21. #define                classCM                'cbnd'
  22. #define                classFT                'fbnd'
  23. #define                classTM                'tbnd'
  24.  
  25.  
  26. //    error codes */
  27. typedef                OSErr    CRMErr;
  28.  
  29. #define                crmGenericError        -1
  30. #define                crmNoErr            0
  31.  
  32. //    crm data structures
  33. #define                crmType                9            /* queue type    */
  34. #define                crmRecVersion          1            /* version of queue structure */
  35.  
  36. struct CRMRec {
  37.     QElemPtr        qLink;
  38.     short            qType;
  39.     short            crmVersion;
  40.     long            crmPrivate;
  41.     short            crmReserved;
  42.  
  43.     long            crmDeviceType;
  44.     long            crmDeviceID;
  45.     long            crmAttributes;
  46.     long            crmStatus;
  47.  
  48.     long            crmRefCon;
  49. };
  50.  
  51. #ifndef __cplusplus
  52. typedef struct CRMRec CRMRec;
  53. #endif
  54. typedef CRMRec *CRMRecPtr;
  55.  
  56. #ifdef __safe_link
  57. extern "C" {
  58. #endif    
  59.  
  60.  
  61. extern pascal CRMErr     InitCRM(void);
  62. extern pascal QHdrPtr     CRMGetHeader(void);
  63. extern pascal void         CRMInstall(QElemPtr crmReqPtr);
  64. extern pascal OSErr     CRMRemove(QElemPtr crmReqPtr);
  65. extern pascal QElemPtr     CRMSearch(QElemPtr crmReqPtr);
  66. extern pascal short     CRMGetCRMVersion(void);
  67.  
  68. extern pascal Handle     CRMGetResource(ResType theType, short theID);
  69. extern pascal Handle     CRMGet1Resource(ResType theType, short theID);
  70. extern pascal Handle     CRMGetIndResource(ResType theType, short index);
  71. extern pascal Handle     CRMGet1IndResource(ResType theType, short index);
  72. extern pascal Handle     CRMGetNamedResource(ResType theType, const Str255 name);
  73. extern pascal Handle     CRMGet1NamedResource(ResType theType, const Str255 name);
  74. extern pascal void         CRMReleaseResource(Handle theHandle);
  75.  
  76. extern pascal long         CRMGetIndex(Handle theHandle);
  77.  
  78. extern pascal short     CRMLocalToRealID(ResType bundleType, short toolID, ResType theKind, short localID);
  79. extern pascal short     CRMRealToLocalID(ResType bundleType, short toolID, ResType theKind, short realID);
  80.  
  81. extern pascal OSErr        CRMGetIndToolName(OSType bundleType, short index, Str255 toolName);
  82. #ifdef __safe_link
  83. }
  84. #endif
  85.  
  86. #endif __CRMINTF__